package com.game.centerserver.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

/**
 * (Order)实体类
 *
 * @author makejava
 * @since 2024-11-19 15:52:46
 */
@Data
@TableName("`orders`")
public class Order implements Serializable {
    private static final long serialVersionUID = 372737673531596517L;
    @TableField("order_num")
    private String orderNum;
    @TableField("uid")
    private String uid;
    @TableField("product_id")
    private Integer productId;
    /**
     * 服务第一次开启的时间
     */
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /**
     * 单位是分钟
     */
    @TableField("duration")
    private Integer duration;
    /**
     * 订单创建的时间
     */
    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 账单金额
     */
    @TableField("bill_amount")
    private BigDecimal billAmount;

    public Order(){}
    public Order(String orderNum, String uid, Integer productId, Date startTime, Integer duration, Date createTime, BigDecimal billAmount) {
        this.orderNum = orderNum;
        this.uid = uid;
        this.productId = productId;
        this.startTime = startTime;
        this.duration = duration;
        this.createTime = createTime;
        this.billAmount = billAmount;
    }

    public Order(String uid) {
        this.uid = uid;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public BigDecimal getBillAmount() {
        return billAmount;
    }

    public void setBillAmount(BigDecimal billAmount) {
        this.billAmount = billAmount;
    }
}

